package animal;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Text {
    public static Animal func2() {
        Dog dog =new Dog(1,"旺财");
        return dog;
    }
    public static void func(Animal animal) {
        animal.eat();
    }

    public static void main(String[] args) {
        Dog dog =new Dog(1,"旺财");
//        dog.eat();
        func(dog);
        Bird bird=new Bird(11,"小鸟");
//        bird.eat();
        func(bird);
    }
    public static void main2(String[] args) {
        Animal animal =func2();
    }

//    public static void main(String[] args) {
//    Animal animal=new Dog(12,"小白");
//    animal.eat();
//    animal.bark();
//    }
}
